package com.bryantkobe.myspringcode.exception;

import com.bryantkobe.myspringcode.exception.massert.BusinessExceptionAssert;

public enum ExceptionEnum implements BusinessExceptionAssert {
    SERVER_EXCEPTION("SERVER_500","服务器出现未知异常"),

    USER_NOT_FOUND("USER_001", "用户不存在"),
    INVALID_PARAMETER("PARAM_001", "参数校验失败"),
    DATA_ACCESS_ERROR("DATA_001", "数据访问异常");

    private final String errorCode;
    private final String defaultMessage;

    ExceptionEnum(String errorCode, String defaultMessage) {
        this.errorCode = errorCode;
        this.defaultMessage = defaultMessage;
    }

    @Override
    public String getErrorCode() { return errorCode; }

    @Override
    public String getDefaultMessage() { return defaultMessage; }
}
